#!/usr/bin/env python

try:
    import stackless
except ImportError:
    print "You don't have stackless!"
    raise
import thread
import world
import server

def main():
    world_instance = world.World()
    world_chan = world_instance.channel
    print world_chan
    #stackless.tasklet(server.get_connections)("localhost", 26734, world_chan)
    #stackless.tasklet(server.game_server)("localhost", 45988, world_chan)
    thread.start_new_thread(server.get_connections,
                            ("localhost", 26734, world_chan))
    thread.start_new_thread(server.game_receiver,
                            ("localhost", 45988, world_chan))
    stackless.run()
    world_instance.update()

if __name__ == "__main__":
    main()
